using System.Collections.Generic;

public class Table_GuideVOItem : IDataItem
{
	/// <summary>
	/// 唯一ID
	/// <summary>
	public int Id { get; private set; }
	/// <summary>
	/// 功能点类型
	/// <summary>
	public int FunType { get; private set; }
	/// <summary>
	/// 优先级
	/// <summary>
	public int Priority { get; private set; }
	/// <summary>
	/// 延时触发
	/// <summary>
	public int DelayTime { get; private set; }
	/// <summary>
	/// 触发等级
	/// <summary>
	public int UserLv { get; private set; }
	/// <summary>
	/// 判断组ID
	/// <summary>
	public bool CheckGroupId { get; private set; }
	/// <summary>
	/// 判断标记
	/// <summary>
	public bool JudgeTag { get; private set; }
	/// <summary>
	/// 组ID
	/// <summary>
	public int GroupId { get; private set; }
	/// <summary>
	/// 前置组ID
	/// <summary>
	public int PreGroupId { get; private set; }
	/// <summary>
	/// 前置引导ID
	/// <summary>
	public int PreId { get; private set; }
	/// <summary>
	/// 后置引导ID
	/// <summary>
	public int NextId { get; private set; }
	/// <summary>
	/// 完成标记
	/// <summary>
	public bool Finish { get; private set; }
	/// <summary>
	/// 完成任务ID
	/// <summary>
	public int TaskId { get; private set; }
	/// <summary>
	/// 打开UIID
	/// <summary>
	public int OpenUId { get; private set; }
	/// <summary>
	/// 关闭UIID
	/// <summary>
	public int CloseUId { get; private set; }
	/// <summary>
	/// 通关副本ID
	/// <summary>
	public int WinFBId { get; private set; }
	/// <summary>
	/// 进入副本ID
	/// <summary>
	public int EnterFBId { get; private set; }
	/// <summary>
	/// 道具
	/// <summary>
	public int GetItemCount() { return Item.Count; }
	private List<int> Item = new List<int>();
	public int GetItemByIndex(int idx)
	{
		return Item.GetValueByIdx(idx, 0);
	}
	/// <summary>
	/// 是否暂停副本
	/// <summary>
	public bool IsPause { get; private set; }
	/// <summary>
	/// 新手关用
	/// <summary>
	public bool IsNewGuideUse { get; private set; }
	/// <summary>
	/// 界面ID
	/// <summary>
	public int GotoUId { get; private set; }
	/// <summary>
	/// 共存UIID
	/// <summary>
	public int GetOpenUICount() { return OpenUI.Count; }
	private List<int> OpenUI = new List<int>();
	public int GetOpenUIByIndex(int idx)
	{
		return OpenUI.GetValueByIdx(idx, 0);
	}
	/// <summary>
	/// string
	/// <summary>
	public string Resources { get; private set; }
	/// <summary>
	/// 对象路径
	/// <summary>
	public string GoPath { get; private set; }
	/// <summary>
	/// 功能点参数
	/// <summary>
	public string FunParam { get; private set; }

	public Table_GuideVOItem(ExcelLineReader reader)
	{
		Id = reader.ReadInt();
		FunType = reader.ReadInt();
		Priority = reader.ReadInt();
		DelayTime = reader.ReadInt();
		UserLv = reader.ReadInt();
		CheckGroupId = reader.ReadBool();
		JudgeTag = reader.ReadBool();
		GroupId = reader.ReadInt();
		PreGroupId = reader.ReadInt();
		PreId = reader.ReadInt();
		NextId = reader.ReadInt();
		Finish = reader.ReadBool();
		TaskId = reader.ReadInt();
		OpenUId = reader.ReadInt();
		CloseUId = reader.ReadInt();
		WinFBId = reader.ReadInt();
		EnterFBId = reader.ReadInt();
		Item = reader.ReadShortString().ToIntList();
		IsPause = reader.ReadBool();
		IsNewGuideUse = reader.ReadBool();
		GotoUId = reader.ReadInt();
		OpenUI = reader.ReadShortString().ToIntList();
		Resources = reader.ReadString();
		GoPath = reader.ReadString();
		FunParam = reader.ReadString();
	}
}

public class Table_GuideVOMgr : IDataMgr
{
	protected override string FileName { get { return "Txt/GuideVO.txt"; } }

	protected Dictionary<int, int> mItemDic = new Dictionary<int, int>();
	public int GetIdxById(int key) { return mItemDic[key]; }

	public override void Load(ExcelLineReader reader)
	{
		var item = new Table_GuideVOItem(reader);
		mItemDic[item.Id] = DataCount;
		mItemList.Add(item);
	}

	public Table_GuideVOItem GetItemByIdx(int idx)
	{
		return GetItemByIdx<Table_GuideVOItem>(idx);
	}

	public Table_GuideVOItem GetItemById(int id)
	{
		int idx = GetIdxById(id);
		return GetItemByIdx(idx);
	}
}